package com.zl.learning.classloader;

import java.lang.reflect.InvocationTargetException;

public class TestForName {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Class<A> aClass = (Class<A>) Class.forName("com.zl.learning.classloader.B");
        A a = aClass.getConstructor().newInstance();
        a.say();
    }
}
